package dc.connectionmanager.logic;

public abstract class ACommand implements ICommand 
{
	IConnectionManager cm;
	
	public ACommand(IConnectionManager cmHandle)
	{
		this.cm = cmHandle;
	}

	@Override
	public void sendCommand(String command) 
	{
		AsyncCommandHandler cmd = new AsyncCommandHandler(this.cm, true);
		cmd.runCommand(command);
		cmd = null;
	}

	@Override
	public void sendCommand(IArgument arg) 
	{
		AsyncCommandHandler cmd = new AsyncCommandHandler(this.cm);
		cmd.runCommand(arg);
		cmd = null;
	}

	@Override
	public void sendCommandNC(String command) 
	{
		this.sendCommand(command);

	}

	@Override
	public void sendCommandAsync(IArgument arg) 
	{
		this.sendCommand(arg);

	}

	@Override
	public Object sendCommandStraight(String command)
	{
		return this.cm.sendCommand(command);
	}

}
